﻿{layout:default} {class:Shop.Admin.theme.Theme_Edit}
<lbhead>
    <title><%=Tag("模板管理")%>-<%=site.title%></title>
</lbhead>
<lbfile>
    <script type="text/javascript" src="<%=site.AdminJsPath %>/ajaxfileupload.js"></script>
    <style>
        textarea
        {
            font-size: 12px;
        }
    </style>
</lbfile>
<lbpath>
    <div class="tools">
        <ul>
            <%if (PageReturnMsg == ""){%>
            <li class="submit"><a href="javascript:void(0);" onclick="SaveObj();"><b></b><span><%=Tag("保存")%></span></a></li>
            <%}%>
            <li class="rotate"><a href="javascript:void(0);" onclick="history.go(-1);"><b></b><span><%=Tag("返回")%></span></a></li>
            <%=publish() %>
            <li class="name"><span id="navIgation">
                <%=Tag("当前位置")%>：<a href="<%=site.AdminPath %>/Ajax/ajax_admin.aspx?__Action=MenuJump&pid=0"><%=Tag("管理首页")%></a> > <a href="<%=site.AdminPath %>/theme/default.aspx"><%=Tag("模板管理")%></a><%if (model.id > 0){ %> > <%=model.Name%> > <%=Tag("配置")%><%}else{ %> > <%=Tag("添加")%><%} %></span></li>
        </ul>
    </div>
</lbpath>
<lbbody>
    <table class="table">
        <tr>
            <th>
                <%=Tag("作者")%>：
            </th>
            <td>
                <%=model.LebiUser %>
            </td>
        </tr>
        <tr>
            <th>
                <%=Tag("名称")%>：
            </th>
            <td>
                <%=GetName()%>
            </td>
        </tr>
        <tr>
            <th>
                <%=Tag("支持语言")%>：
            </th>
            <td>
                <%=GetLanguage()%>
            </td>
        </tr>
        <tr>
            <th style="vertical-align:top">
                <%=Tag("启用语言")%>：
            </th>
            <td>
                <%= Shop.Bussiness.Language.SiteLanguageCheckbox("Language_ids", GetLanguageid(model), CurrentLanguage.Code)%>
            </td>
        </tr>
        <tr>
            <th valign="top" style="width: 15%;">
                <%=Tag("缩略图")%>：
            </th>
            <td>
                <%if (model.id > 0)
                  { %>
                <div id="image_ImageUrl">
                    <%if (model.ImageSmallUrl != "")
                      {%>
                    <img height="50" src="<%=Shop.Bussiness.ThemeUrl.CheckURL(WebPath + model.Path_Files+"/"+model.ImageSmallUrl)%>" />
                    <%} %>
                </div>
                <%=GetUpLoadDiv()%> <em><%=Tag("推荐尺寸")%>：600*600px</em>
                <%}
                  else
                  { %>
                <%=Tag("保存后上传") %>
                <%} %>
            </td>
        </tr>
        <tr>
            <th>
                <%=Tag("模板路径")%>：
            </th>
            <td>
                <input type="text" id="Path_Files" name="Path_Files" class="input" shop="true" style="width: 500px;"
                    value="<%=model.Path_Files %>" />
            </td>
        </tr>
        <tr>
            <th>
                <%=Tag("JS文件路径")%>：
            </th>
            <td>
                <input type="text" id="Path_JS" name="Path_JS" class="input" shop="true" style="width: 500px;"
                    value="<%=model.Path_JS %>" />
            </td>
        </tr>
        <tr>
            <th>
                <%=Tag("CSS文件路径")%>：
            </th>
            <td>
                <input type="text" id="Path_CSS" name="Path_CSS" class="input" shop="true" style="width: 500px;"
                    value="<%=model.Path_CSS %>" />
            </td>
        </tr>
        <tr>
            <th>
                <%=Tag("图片文件路径")%>
                ：
            </th>
            <td>
                <input type="text" id="Path_Image" name="Path_Image" class="input" shop="true" style="width: 500px;"
                    value="<%=model.Path_Image %>" />
            </td>
        </tr>
        <tr>
            <th>
                <%=Tag("图片尺寸")%>：
            </th>
            <td>
                <input type="text" id="ImageMedium_Width" name="ImageMedium_Width" style="width: 70px"
                    shop="true" class="input" value="<%=model.ImageMedium_Width %>" onkeyup="value=value.replace(/[^\d]/g,'')"
                    maxlength="4" />
                *
                <input type="text" id="ImageMedium_Height" name="ImageMedium_Height" style="width: 70px"
                    shop="true" class="input" value="<%=model.ImageMedium_Height %>" onkeyup="value=value.replace(/[^\d]/g,'')"
                    maxlength="4" />
            </td>
        </tr>
        <tr>
            <th style="vertical-align:top">
                <%=Tag("描述")%>：
            </th>
            <td>
                <textarea id="Description" name="Description" shop="true" cols="95" rows="4" class="textarea"
                    style="width: 500px; height: 60px;"><%=model.Description%></textarea>
                <div class="tools clear">
                    <ul>
                        <li class="plus"><a href="javascript:void(0);" onclick="javascript:resizeEditor('Description',100);">
                            <b></b><span>
                                <%=Tag("展开")%></span></a></li>
                        <li class="minus"><a href="javascript:void(0);" onclick="javascript:resizeEditor('Description',-100)">
                            <b></b><span>
                                <%=Tag("收缩")%></span></a></li>
                    </ul>
                </div>
            </td>
        </tr>
        <tr>
            <th>
                <%=Tag("升级")%>：
            </th>
            <td>
                <label><input type="radio" name="IsUpdate" value="1" shop="true" <%=model.IsUpdate==1?"checked":"" %> /><%=Tag("开启")%></label>
                <label><input type="radio" name="IsUpdate" value="0" shop="true" <%=model.IsUpdate==0?"checked":"" %> /><%=Tag("关闭")%></label>
            </td>
        </tr>
        <tr>
            <th>
                <%=Tag("排序序号")%>：
            </th>
            <td>
                <input type="text" id="Sort" name="Sort" style="width: 70px" shop="true" class="input"
                    value="<%=model.Sort %>" onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"
                    maxlength="4" />
            </td>
        </tr>
    </table>
    <script type="text/javascript">
    function SaveObj() {
        var postData = GetFormJsonData("shop");
        var url="<%=site.AdminPath %>/ajax/ajax_theme.aspx?__Action=Theme_Edit&id=<%=model.id %>";
//        RequestAjax(url,postData,function(res){MsgBox(1, "<%=Tag("操作成功")%>", "?id="+res.id)})
        RequestAjax(url,postData,function(res){MsgBox(1, "<%=Tag("操作成功")%>", "default.aspx")});
    }
    function Publish()
    {
        var postData = GetFormJsonData("shop");
        var url="<%=site.AdminPath %>/ajax/ajax_theme.aspx?__Action=Theme_publish&id=<%=model.id %>";
        RequestAjax(url,postData,function(res){MsgBox(1, "<%=Tag("操作成功")%>", "?id=<%=model.id %>")});
    }
    </script>
    <script type="text/javascript">
        function uploadImage(id) {
            var path = $("#Path_Files").val();
            $.ajaxFileUpload
        (
	        {
	            url: WebPath + '/ajax/imageupload_theme.aspx?path=' + path,
	            secureuri: false,
	            fileElementId: 'file_' + id,
	            dataType: 'json',
	            success: function (data, status) {
	                if (data.msg != 'OK') {
	                    MsgBox(2, data.msg, "");
	                }
	                else {
	                    var imageUrl = data.ImageUrl;
	                    var tpath = $("#Path_Files").val();
	                    if (imageUrl.length > 0) {
	                        $("#image_" + id + "").html('<img height="50" src=' + WebPath + tpath + "/" + imageUrl + '>');
	                        $("#" + id + "").val(imageUrl);
	                    }
	                }

	            }
	        }
        )
        }
    </script>
</lbbody>
